﻿using Microsoft.EntityFrameworkCore;
using SmartWMS.Domain.BasicsDatum;
using SmartWMS.Domain.BusinessManage;
using SmartWMS.Domain.FinanceManage;
using SmartWMS.Domain.StatementManage;
using SmartWMS.Domain.SystemSet;
using SmartWMS.Domain.WarehouseManage;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartWMS.EntityFramework
{
    public class SmartWMSContext :DbContext
    {
        /// <summary>
        /// 重写OnConfiguring方法，配置数据库连接字符串
        /// </summary>
        /// <param name="options"></param>
        public SmartWMSContext(DbContextOptions<SmartWMSContext> options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

        }

        #region   系统设置
        /// <summary>
        /// 人员表
        /// </summary>
        public DbSet<Staff>? Staff { get; set; }
        /// <summary>
        /// 人员角色关联表
        /// </summary>
        public DbSet<StaffRoles>? StaffRoles { get; set; }
        /// <summary>
        /// 角色表
        /// </summary>
        public DbSet<Role>? Role { get; set; }
        /// <summary>
        /// 角色权限关联表
        /// </summary>
        public DbSet<RolePermissions>? RolePermissions { get; set; }
        /// <summary>
        /// 权限表
        /// </summary>
        public DbSet<Permissions>? Permissions { get; set; }
        /// <summary>
        /// 字典明细表
        /// </summary>
        public DbSet<DictItem>? DictItem { get; set; }
        /// <summary>
        /// 公共字典表
        /// </summary>
        public DbSet<DicType>? DicType { get; set; }
        /// <summary>
        /// 消息中心
        /// </summary>
        public DbSet<MessageCenter>? MessageCenter { get; set; }
        #endregion


        #region 基础资料

        /// <summary>
        /// 承运商表
        /// </summary>
        public DbSet<Carrier>? Carrier { get; set; }

        /// <summary>
        /// 产品类别表
        /// </summary>
        public DbSet<Category>? Category { get; set; }

        /// <summary>
        ///  客户表
        /// </summary>
        public DbSet<Custom>? Custom { get; set; }

        /// <summary>
        /// 设备管理表
        /// </summary>
        public DbSet<Equipment>? Equipment { get; set; }

        /// <summary>
        /// 库位
        /// </summary>
        public DbSet<Location>? Location { get; set; }

        /// <summary>
        /// 产品表
        /// </summary>
        public DbSet<Product>? Product { get; set; }

        /// <summary>
        /// 产品库存详情表
        /// </summary>
        public DbSet<ProductStorageDetail>? ProductStorageDetail { get; set; }

        /// <summary>
        /// 供应商表
        /// </summary>
        public DbSet<Supplier>? Supplier { get; set; }

        /// <summary>
        /// 单位表
        /// </summary>
        public DbSet<Unit>? Unit { get; set; }

        /// <summary>
        /// 仓库表
        /// </summary>
        public DbSet<Warehouse>? Warehouse { get; set; }

        /// <summary>
        /// 客户联系人
        /// </summary>
        public DbSet<CustomContact>? CustomContact { get; set; }

        #endregion


        #region 业务管理

        /// <summary>
        /// 财务记账表
        /// </summary>
        public DbSet<Accounting>? Accounting { get; set; }

        /// <summary>
        /// 采购管理
        /// </summary>
        public DbSet<ProcureManagement>? ProcureManagement { get; set; }

        /// <summary>
        /// 采购退货
        /// </summary>
        public DbSet<ProcuremenReturn>? ProcuremenReturn { get; set; }

        /// <summary>
        /// 销售管理
        /// </summary>
        public DbSet<SalesManagement>? SalesManagement { get; set; }

        /// <summary>
        /// 销售明细表
        /// </summary>
        public DbSet<SalesManageDetail>? SalesManageDetail { get; set; }

        /// <summary>
        /// 销售退货
        /// </summary>
        public DbSet<SalesReturn>? SalesReturn { get; set; }

        /// <summary>
        /// 采购产品关联表
        /// </summary>
        public DbSet<Shopping>? Shopping { get; set; }

        #endregion


        #region 财务管理

        /// <summary>
        /// 应收表
        /// </summary>
        public DbSet<Collection>? Collection { get; set; }

        /// <summary>
        /// 应付表
        /// </summary>
        public DbSet<Payment>? Payment { get; set; }

        /// <summary>
        /// 支付类别表
        /// </summary>
        public DbSet<PayType>? PayType { get; set; }

        #endregion


        #region 报表管理

        /// <summary>
        /// 库存清单
        /// </summary>
        public DbSet<Inventory>? Inventory { get; set; }

        /// <summary>
        /// 库存台账
        /// </summary>
        public DbSet<InventoryBook>? InventoryBook { get; set; }

        /// <summary>
        /// 盘点台账表
        /// </summary>
        public DbSet<InventoryLedger>? InventoryLedger { get; set; }

        /// <summary>
        /// 期初期末表
        /// </summary>
        public DbSet<StartEnd>? StartEnd { get; set; }

        #endregion


        #region 仓库管理

        /// <summary>
        /// 调拨单号
        /// </summary>
        public DbSet<Allot>? Allot { get; set; }

        /// <summary>
        /// 调拨明细表
        /// </summary>
        public DbSet<AllotDetail>? AllotDetail { get; set; }

        /// <summary>
        /// 盘点表
        /// </summary>
        public DbSet<Check>? Check { get; set; }

        /// <summary>
        /// 盘点明细表
        /// </summary>
        public DbSet<CheckDetails>? CheckDetails { get; set; }

        /// <summary>
        /// 报损表
        /// </summary>
        public DbSet<FrmLoss>? FrmLoss { get; set; }

        /// <summary>
        /// 报损明细表
        /// </summary>
        public DbSet<FrmLossDetail>? FrmLossDetail { get; set; }

        /// <summary>
        /// 入库表
        /// </summary>
        public DbSet<InWarehouse>? InWarehouse { get; set; }

        /// <summary>
        /// 入库明细表
        /// </summary>
        public DbSet<InWarehouseDetail>? InWarehouseDetail { get; set; }

        /// <summary>
        /// 出库表
        /// </summary>
        public DbSet<OutWarehouse>? OutWarehouse { get; set; }

        /// <summary>
        /// 出库明细表
        /// </summary>
        public DbSet<OutWarehouseDetail>? OutWarehouseDetail { get; set; }

        
        /// <summary>
        /// 移库表
        /// </summary>
        public DbSet<Relocation>? Relocation { get; set; }

        /// <summary>
        /// 移库明细表
        /// </summary>
        public DbSet<RelocationDetail>? RelocationDetail { get; set; }
        #endregion



    }
}
